package imp

import (
	"bgs/db"
	syncGrpc "bgs/grpc/gen/service/sync"
	"bgs/util"
	"context"
	"go.uber.org/zap"
)

// SyncAPIService :grpc server proxy of sync
type SyncAPIService struct {
	dao  *db.PgDao
	slog *zap.SugaredLogger
	syncGrpc.SyncOpServer
}

// NewSyncAPIService initialization
func NewSyncAPIService(pgdao *db.PgDao, slog *zap.SugaredLogger) *SyncAPIService {
	return &SyncAPIService{
		dao:  pgdao,
		slog: slog.With("module", "SyncAPIService"),
	}
}

// NewContextLogger create a SugaredLogger with contextvalue
func (s *SyncAPIService) NewContextLogger(ctx context.Context) *zap.SugaredLogger {
	return util.NewContextLogger(ctx, s.slog)
}
